The present invention relates generally to data validation, and in particular to providing a scalable architecture for validating data that reduces duplication of code and enables easy creation of new validations.
In many computer-and network-based systems, information often needs to be validated to ensure, for example, that the information is complete, correct, in the proper format, of a maximum length, or any of a number of other such aspects. When validating data to be stored into a database system, for example, there can be a number of such validations that can be done, with strict rules as to the form and content of the data. Because many systems today are distributed and further involve both client-side and server-side aspects, this can allow validation to be done at a number of different points across a system or network. Because these different points can be different types of devices, can be running different software, and/or can utilize different technology, different versions of the code needed for data validation typically needs to be generated and maintained, which results in an undesirable duplication of code. The need for such duplication further results in increased cost and time in developing, maintaining, and deploying the code, as well as increased complexity in calling validations depending upon where the validation will be done.
In an example of an e-business application, for example, applications can be developed on two main technology stacks, such as Java and PL/SQL. FIG. 1 illustrates an exemplary environment 100 for implementing such an application, wherein a client device 102 communicates with an application server 108 across a network 104. In this example the network is the Internet, and the environment accordingly utilizes a Web server 106 to receive requests and serve content, but it should be understood that any of a number of other appropriate networks such as intranets or local area networks (LANs) can be used as discussed elsewhere herein. In such an environment, a validation can be done on the client device 102, such as before the data is submitted across the network, and another validation can be done at the application server 108 (or another appropriate back-end device) before the data is entered into the appropriate data storage device 110. In one example, and entity level validation can be done on the client device, such as for validating that the quantity for an item being ordered on a purchase order is greater than 0, using a Business Components for Java (BC4J) architecture for a browser application where the validation code is generally contained within the entity object (EO) itself. A validation also can be done on the back-end, or the client side, for an import program using PL/SQL or another appropriate language, which allows the data to be imported without a user having to enter the data through the browser application. Both the validation module for the browser application and the validation module for the import application need to execute the same (or similar) validations, such as where each supports purchase order creation. Currently, this requires repeating the validations in both technology stacks, utilizing different code algorithms.
Further, there may be a number of fields of data that need to be validated. Currently, there is no easy way to control the order and timing of the validations for the various fields. When passing between pages such as a summary page and a detail page, it would be desirable to be able to control the order and timing, along with other such aspects.